package com.example.yadmin.sys.service.impl;

import com.example.yadmin.sys.entity.Goods;
import com.example.yadmin.sys.entity.UserRole;
import com.example.yadmin.sys.mapper.UserRoleMapper;
import com.example.yadmin.sys.service.IUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ag
 * @since 2023-10-09
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {


    @Override
    public List<UserRole> getUserRoleListByUserId(Integer userId) {
        List<UserRole> list = this.baseMapper.getUserRoleListByUserId(userId);
        return list;
    }

    @Override
    public void addUserRole(UserRole userRole) {
        this.baseMapper.insert(userRole);
    }

    @Override
    public void updateUserRole(UserRole userRole) {
        this.baseMapper.updateById(userRole);
    }
}
